# -*- coding: utf-8 -*-
from PO.BasePage import Base


class SearchPage(Base):
    # Action
    hot_loc = ('id', 'com.guokr.mentor:id/tv_hot_tag')
    insurance_loc = ('xpath', "//android.widget.TextView[@text='保险']")
    finan_loc = ('xpath', "//android.widget.TextView[@text='理财']")

    def hot(self):
        """热门搜索"""
        return self.find_element(self.hot_loc).text

    def insurance(self):
        """保险"""
        self.find_element(self.insurance_loc).click()

    def finan(self):
        """理财"""
        self.find_element(self.finan_loc).click()
